// 
import axios from '@/functions/request';

function loginIn(params){
    return new Promise((resolve, reject)=>{
        axios.formPost("/web/sysuser/login",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
/**
 * add by zhujq 登陆时关闭登录用户已存在的客户端链接
 */
function disconnect(userId){
    let params = {};
    params.userId = userId;
    return new Promise((resolve, reject)=>{
        axios.post("/api/mess/send/doDisconnect",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function mustChangePass(params){
    return new Promise((resolve, reject)=>{
        axios.formPost("/api/auth/sysuser/promptUpdatePassword",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
export{
    loginIn,
    disconnect,
    mustChangePass
}